-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure iface.FirstPublicAddress isn't a secondary IP #5393
Ensure iface.FirstPublicAddress isn't a secondary IP #5393
Conversation
5bd23e7
to
6e19e87
Compare
This pull request has merge conflicts that need to be resolved. |
6e19e87
to
afe41ed
Compare
afe41ed
to
7ec5bec
Compare
7ec5bec
to
a8ad61b
Compare
On one of my previous attempts I noticed a few things I didn't like in the check-backup inttest. I don't think these are worth a full PR so I decided to sneak these here, but it can be dropped as it's not really the intent of this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the title "Prevent CPLB VIPs to be etcd's peer address" is a bit misleading. That's the issue that's getting fixed, but I think a more technical title might be a better fit for the PR. Something that mentions that we're now disregarding secondary IPs when detecting IP addresses.
a8ad61b
to
f1a5e1c
Compare
f1a5e1c
to
b1110a2
Compare
Only for linux Co-authored-by: Tom Wieczorek <twz123@users.noreply.github.com> Signed-off-by: Juan-Luis de Sousa-Valadas Castaño <jvaladas@mirantis.com>
Add -d to make things easier to troubleshoot, remove redundant checks, fix typos and make some checks slightly shorter. Signed-off-by: Juan-Luis de Sousa-Valadas Castaño <jvaladas@mirantis.com>
b1110a2
to
5a69092
Compare
if ipnet, ok := a.(*net.IPNet); ok && !ipnet.IP.IsLoopback() { | ||
if ipnet.IP.To4() != nil { | ||
return ipnet.IP.String(), nil | ||
if a != nil && !a.IP.IsLoopback() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The nil check cloud theoretically be removed, because both sequence implementations won't yield nil values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
This fixes only the automatic address detection for etcd. If a user configures them manually it doesn't attempt to prevent the error.
Fixes #4664
Type of change
How Has This Been Tested?
Checklist: